﻿<UserControl x:Class="QuailDashboard.View.Controls.TestNoteControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:C1SilverlighRichTextBox="clr-namespace:C1.Silverlight.RichTextBox;assembly=C1.Silverlight.RichTextBox" 
    xmlns:C1SilverlighRichTextBoxToolbar="clr-namespace:C1.Silverlight.RichTextBox;assembly=C1.Silverlight.RichTextBox.Toolbar" 
    Width="650"
    Height="450"
    >
    <Grid x:Name="LayoutRoot"
          Background="Transparent"
          SizeChanged="LayoutRoot_SizeChanged"
          Width="650"
          Height="450"
        >
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border x:Name="borderBorder"
                Grid.Row="0"
                Grid.RowSpan="2"
                CornerRadius="5" 
				Background="White"
                BorderBrush="LightGray"
                BorderThickness="1"
                >
            <Border.Effect>
                <DropShadowEffect />
            </Border.Effect>
        </Border>
        <TextBlock Text="{Binding WindowTitle}" FontSize="18" FontWeight="Bold" Margin="10" Grid.Row="0" />
        <Grid x:Name="EditGrid" Grid.Row="1" Margin="10" >
            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition x:Name="RowRichTextBox" />
                <RowDefinition Height="35" x:Name="RowSave" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="75"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="User: " FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left" />
            <TextBox Grid.Row="0" Grid.Column="1" x:Name="TextBoxUser" Margin="0,1,10,1" VerticalAlignment="Center" IsReadOnly="True" Text="{Binding Data.CreatedBy}" />
            <TextBlock Grid.Row="1" Grid.Column="0" Text="Created: " FontWeight="Bold" VerticalAlignment="Center" />
            <TextBox Grid.Row="1" Grid.Column="1" x:Name="TextBoxCreated" Margin="0,1,10,1" VerticalAlignment="Center" IsReadOnly="True" Text="{Binding Data.CreateDate}" />
            <TextBlock Grid.Row="2" Grid.Column="0" Text="Notes: " FontWeight="Bold" VerticalAlignment="Center"/>
            <StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Vertical" x:Name="StackPanelRichTextBox">
                <TextBox x:Name="TextBoxNotes" Text="{Binding Data.Note, Mode=TwoWay}"  AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" />
                <!-- <C1SilverlighRichTextBoxToolbar:C1RichTextBoxToolbar x:Name="RichTextBoxNotesToolbar"/>
                <C1SilverlighRichTextBox:C1RichTextBox 
                    x:Name="RichTextBoxNotes"
                    TextWrapping="Wrap"
                    AcceptsReturn="True"
                    Html="{Binding Data.Note, Mode=TwoWay}"
                    /> -->
            </StackPanel>
            <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Margin="0,5,0,5" Click="ButtonSave_Click">
                    <StackPanel Orientation="Horizontal">
                            <TextBlock Text=" Save " />
                            <Image
                                Stretch="None"
                                Source="{StaticResource IconSave}"
                                Margin="0,0,5,0"
                                ToolTipService.ToolTip="Save the note" />
                        </StackPanel>
                </Button>

                <Button Margin="5,5,0,5" Click="ButtonCancel_Click">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text=" Cancel " />
                        <Image
                                Stretch="None"
                                Source="{StaticResource IconCancel}"
                                Margin="0,0,5,0"
                                ToolTipService.ToolTip="Change changes note" />
                    </StackPanel>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
